echo 仅限debian12
echo -e 'nnnnnnnnnn####################################n'

sudo rm /etc/apt/sources.list

sudo touch /etc/apt/sources.list

sudo echo -e "# 默认注释了源码镜像以提高 apt update 速度，如有需要可自行取消注释nndeb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-freen# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm main contrib non-freenndeb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-freen# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-updates main contrib non-freenndeb http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-freen# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian/ bookworm-backports main contrib non-freenndeb http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-freen# deb-src http://mirrors.tuna.tsinghua.edu.cn/debian-security bookworm-security main contrib non-free" >> /etc/apt/sources.list

echo -e '1、默认软件源修改完成！nn'

sudo sed -i '1c deb http://mirrors.tuna.tsinghua.edu.cn/Adoptium/deb bookworm main' /etc/apt/sources.list.d/AdoptOpenJDK.list

gpg --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 843C48A565F8F04B

sudo gpg --armor --export 843C48A565F8F04B | sudo apt-key add -

echo -e 'nn2、AdoptOpenJDK报错修复完成！nn'

sudo sed -i '1c #deb http://repo.mobian-project.org/ bullseye main non-free'  /etc/apt/sources.list.d/mobian.list

echo -e '3、Mobian源报已屏蔽！'

echo -e 'nn####################################nn即将开始更新软件源list......n'

sleep 5

sudo apt-get update

echo -e 'nn4、更新软件源list更新完成！'

echo -e 'nn####################################nn即将开始升级系统程序至最新版......'

sleep 5

sudo apt-mark hold openssh-server

sudo apt-get  update

sudo apt-mark unhold openssh-server

echo -e 'nn5、系统程序更新完成！nn####################################nnnn'

